// 判断页面是否加载超时
setTimeout(
  function () {
    let timeoutTimes = parseInt(sessionStorage.getItem("timeout"));
    if (!document.body.classList.contains("loaded")) {
      document.querySelector("#loader").classList.add("timeout");
      document.querySelector("#loader .loader--timeout").addEventListener("click", () => {
        window.stop();
        const diffTime = new Date(2023, 1, 1);
        const cacheId = parseInt(((new Date().getTime() - diffTime.getTime()) / 1000).toFixed(0)).toString(36);
        const newUrl = new URL(location.href);
        newUrl.searchParams.delete("ts");
        newUrl.searchParams.append("ts", cacheId);
        location.href = newUrl.href;
      });
      timeoutTimes++;
      sessionStorage.setItem("timeout", timeoutTimes);
    }
  },
  (Math.random() * 3000 + 7000) >> 0
);
